<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script>
			function handle(event){
				var oevent = event || window.event;				
				var ele = oevent.srcElement || oevent.target;
				console.log("你"+oevent.type+"了"+ele.innerHTML);
				
			}
		</script>
	</head>
	<body>
		<button>按钮1</button>
		<button>按钮2</button>
		<button>按钮3</button>
		<button>按钮4</button>
		<button>按钮5</button>
		<script>
			btns = document.getElementsByTagName("button");
			for (i=0;i<btns.length;i++) {
				btns[i].onclick = handle;
				btns[i].onmouseover=handle;
			}
		</script>
	</body>
</html>
